#ifndef UTIL_THREADSAFEBOOL
#define UTIL_THREADSAFEBOOL
#include <boost/thread.hpp>
#include <boost/noncopyable.hpp>
namespace Util{
class ThreadSafeBool : private boost::noncopyable
{
public:
	ThreadSafeBool():
	 m_bool(false)
	,m_mutex()
	{
	}
	void set(bool val)
	{
		boost::mutex::scoped_lock lock(m_mutex);
		m_bool = val;
	}
	bool get()
	{
		boost::mutex::scoped_lock lock(m_mutex);
		return m_bool;
	}
private:
	boost::mutex m_mutex;
	bool m_bool;
};
}//Util
#endif